﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Web;
using System.Web.Security;

namespace OnlineMealOrdering.Extends
{
    public class CustomPrincipal:IPrincipal
    {
        private CustomIdentity _identity;
        private RolePrincipal _principal;

        public CustomPrincipal(CustomIdentity identity,RolePrincipal pricipal)
        {
            _identity = identity;
            _principal = pricipal;
        }

        public IIdentity Identity
        {
            get 
            {
                return _identity;
            }
        }

        public bool IsInRole(string role)
        {
            return _principal.IsInRole(role);
        }
    }
}